-
Notifications
You must be signed in to change notification settings - Fork 272
feat: add 'include-methods' config to 'missing-test-assertion' rule #1026
feat: add 'include-methods' config to 'missing-test-assertion' rule #1026
Conversation
@orevial LGTM 🚀 , could you update the changelog? |
dd7ba97
to
307e120
Compare
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## master #1026 +/- ##
==========================================
+ Coverage 86.85% 86.86% +0.01%
==========================================
Files 327 327
Lines 7014 7021 +7
==========================================
+ Hits 6092 6099 +7
Misses 922 922
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@incendial I'm trying to test the new rule on my project by importing the package from Git but for some reason the rule does not trigger anything, am I missing something ? dart_code_metrics:
git:
url: https://github.com/orevial/dart-code-metrics.git
ref: feat-missing-test-assertion-rule My sample unit test : test('trigger test lint', () {
// do nothing, should trigger lint
}); |
Hm... have you added the rule to the analysis_options? |
🤦♂️ Thank you 😅 |
Actually even then it's still not using the rule with my incorrect tests... |
I'll merge it and take a look a little bit later, right now I don't see anything wrong with the rule |
What is the purpose of this pull request? (put an "X" next to an item)
Completes issue #1019, PR #1023
What changes did you make? (Give an overview)
This PR aims at completing issue #1019 and PR #1023 about the new missing_test_assertion rule, by adding the possibility to enter additional test methods names to be checked in addition to the default
test
andtestWidgets
methods.This new config might be useful when using dedicated test methods that potentially come from other packages, or just test wrappers written by the developers. E.g. we could create a base
companyXTest()
method that acts as a wrapper around test/testWidgets and sets some basic configuration for our company tests.As a side note, I also changed the severity from "style" to "warning" in the doc, seems more appropriate.
Is there anything you'd like reviewers to focus on?
Config name, I can change it if "include-methods" is not clear enough.